<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>机构列表</title>
    <link rel="stylesheet" href="/gzht/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/gzht/lib/layui/formselects/formSelects-v4.css">
    <link rel="stylesheet" href="/gzht/lib/Hui-iconfont/1.0.8/iconfont.min.css" media="all">
    <style>
        .dep_bg_red{
            background-color: rgba(166,166,166,0.5);
        }
    </style>
</head>
<body>
<table id="table1" class="layui-table" lay-filter="table1"></table>
<%--表头工具--%>
<script type="text/html" id="h_tool">
    <button class="layui-btn layui-btn-sm" lay-event="h_add"><i class="layui-icon">&#xe654;</i>新增</button>
    <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="h_expend"><i class="layui-icon">&#xe630;</i>展开/折叠</button>
</script>
<%--行内工具--%>
<script type="text/html" id="col_tool">
    <div class="layui-btn-group">
        <button type="button" class="layui-btn layui-btn-xs" lay-event="col_edit">
            <i class="layui-icon">&#xe642;编辑</i>
        </button>
        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event="col_del">
            <i class="layui-icon">&#xe640;删除</i>
        </button>
    </div>
</script>
<%--部门选择--%>
<div style="display: none;" id="part"></div>
<%--添加机构表单--%>
<div id="addDepFormArea" style="display: none;padding: 1rem;">
    <form class="layui-form" action="" id="addDepForm">
        <div class="layui-form-item">
            <label class="layui-form-label">上级部门</label>
            <div class="layui-input-block">
                <%--提交值--%>
                <input id="submitDep" type="hidden" name="departmentParentNo" lay-verify="adminPartNo" readonly class="layui-input">
                <%--显示值--%>
                <input id="showPart" readonly type="text" placeholder="未选择上级部门" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称</label>
            <div class="layui-input-block">
                <input type="text" name="departmentName" required  lay-verify="required" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" value="0" name="departmentStatus" lay-skin="switch" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="departmentRemark" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="addDepSubmit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<%--编辑机构表单--%>
<div id="editDepFormArea" style="display: none;padding: 1rem;">
    <form class="layui-form" lay-filter="editForm" action="" id="editDepForm">
        <input type="hidden" name="departmentNo">
        <div class="layui-form-item">
            <label class="layui-form-label">上级部门</label>
            <div class="layui-input-block">
                <%--提交值--%>
                <input id="edit_submitDep" type="hidden" name="departmentParentNo" lay-verify="adminPartNo" readonly class="layui-input">
                <%--显示值--%>
                <input id="edit_showPart" name="departmentParentName" readonly type="text" placeholder="未选择上级部门" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称</label>
            <div class="layui-input-block">
                <input type="text" name="departmentName" required  lay-verify="required" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" value="0" name="departmentStatus" lay-skin="switch" lay-text="正常|禁用" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="departmentRemark" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="editDepSubmit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script src="/gzht/statics/js/jquery-1.12.2.min.js"></script>
<script src="/gzht/lib/layui/layui.js"></script>
<script src="/gzht/lib/layui/formselects/formSelects-v4.js"></script>
<script src="/gzht/statics/utils/TreeUtil.js"></script>
<script src="/gzht/statics/js/departmentList/departmentList.js"></script>
</body>
</html>
